class Solution:
    def combinationSum(self, candidates, target):
        res = []
        self.dfs()
        return res
    def dfs(self, cands, target, ind, path, res):
        if target == 0:
            res.append(path)
            return
        if target < 0:
            return
        for i in range(ind, len(cands)):
            self.dfs(cands, target-cands[i], i, path+[cands[i]], res)
